package com.nine.pattern.factory.simple;

/**
 * @author nine
 * @version 1.0
 * @description 简单咖啡工厂
 * @date 2024-06-27 22:13
 */
public class SimpleCoffeeFactory {

	public Coffee createCoffee(String type) {
		Coffee coffee = null;
		if ("latte".equals(type)) {
			coffee = new LatteCoffee();
		}
		else if ("american".equals(type)) {
			coffee = new AmericanCoffee();
		}
		else {
			throw new RuntimeException();
		}
		return coffee;
	}

}
